package ar.com.fiuba.ElectronicCircuitAnalyst.domain.api;

import java.util.List;

import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.LeadConnectionLimitReachedException;

/**
 * Interface for an end (terminal) of a connection. This end needs to have a
 * value which can be set.
 */
public interface Lead {

	/**
	 * Returns the current value of this lead
	 * 
	 * @return the value of this lead
	 */
	public Boolean getValue();

	/**
	 * Sets a new value for this Lead
	 * 
	 * @param value
	 *            the new value for this lead
	 */
	public void setValue(Boolean value);

	/**
	 * Adds a new connection to this Lead
	 * 
	 * @param connection
	 * @throws ConnectionLimtException
	 *             if the connection limit is reached
	 */
	public void addConnection(Connection connection) throws LeadConnectionLimitReachedException;
	/**
	 * Tells if the current lead is connected to one or more leads.
	 * 
	 * @return true if it is connected to one or more leads.
	 */
	public Boolean isConnected();

	/**
	 * @return the connections to this lead
	 */
	public List<Connection> getConnections();
	
}
